﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ManageProblemType.aspx.cs" Inherits="WXYW.ManageProblemType" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="Ajax" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitlePlaceHolder" runat="server">
    管理故障类型
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ButtonPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="RightContentPlaceHolder" runat="server">
    <asp:GridView ID="MainGridView" runat="server" AutoGenerateColumns="False"
        CssClass="tableList" Width="100%" OnRowDataBound="MainGridView_RowDataBound"
        onrowcommand="GridView_RowCommand">
        <Columns>
            <asp:TemplateField HeaderImageUrl="~/image/operateicon/button_Select.gif">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="IDLbl" runat="server"></asp:Label>
                </ItemTemplate>
                <HeaderStyle Width="5%" />
                <ItemStyle Width="5%" />
            </asp:TemplateField>
            <asp:BoundField HeaderText="名称" DataField="Name">
                <HeaderStyle Width="55%" />
                <ItemStyle />
            </asp:BoundField>
            <asp:TemplateField HeaderText="操作" ShowHeader="False">
                <ItemTemplate>
                    <img src="image/operateicon/docedit.gif" alt="" />
                    <asp:LinkButton ID="editLnkBtn" runat="server" CausesValidation="false" CommandName="EditType"
                        Text="修改" CommandArgument='<%#Eval("ID") %>'></asp:LinkButton>
                    <img src="image/operateicon/docdelete.gif" alt="" />
                    <asp:LinkButton ID="deleteLnkBtn" runat="server" CausesValidation="false" CommandName="DeleteType"
                        Text="删除" CommandArgument='<%#Eval("ID") %>'></asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <table style="text-align: center" width="100%">
        <tr>
            <td style="text-align: center; width : 20%">&nbsp</td>
            <td style="text-align: center">
                <table border="0px" cellpadding="0" cellspacing="0" style="border-style: none; text-align: center" width="100%">
                <tr style="border-style: none; text-align: center">
                    <td style="border-style: none; width :20%">
                        <span style="color : Red">*&nbsp</span>名称：
                    </td>
                    <td style="border-style: none; text-align: left; width :50%">
                        <asp:TextBox ID="addNameTxtBox" runat="server" Width="80%"></asp:TextBox>
                    </td>
                    <td>
                        <asp:Button ID="addBtn" runat="server" Text="添加" OnClick="addBtn_Click" ValidationGroup="addValidations"/>
                    </td>
                    <td>
                       <asp:RequiredFieldValidator ID="RequiredFieldValidatorForAdd" runat="server" ErrorMessage="请输入名称"
                        Text="请输入名称" ControlToValidate="addNameTxtBox" ValidationGroup="addValidations"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                </table>
            </td>
            <td style="text-align: center; width : 20%">&nbsp</td>
        </tr>
    </table>
    
    
    <asp:HiddenField ID="hideButton" runat="server"></asp:HiddenField>
    <Ajax:ModalPopupExtender ID="EditNameModal" TargetControlID="hideButton"
        PopupControlID="EditNamePanel" BackgroundCssClass="modalBackground" runat="server"
        Drag="true" PopupDragHandleControlID="editDragBar" CancelControlID="cancelBtn">
    </Ajax:ModalPopupExtender>
    <asp:Panel ID="EditNamePanel" CssClass="modalPopup" Width="400px" runat="server"
         DefaultButton="saveBtn" Style="display: none">
        <!-- Header -->
        <div class="box-header" id="editDragBar">
            <img src="image/stdBox_left_top.gif" alt="" />
            <h2>
                修改名称</h2>
            <asp:HiddenField ID="IDHiddenField" runat="server" />
        </div>
        <div class="functionPanel"> 
            <table style="text-align: center" width="100%">
                <tr>
                    <td style="text-align: center">
                        <table border="0px" cellpadding="0" cellspacing="0" style="border-style: none; text-align: center" width="100%">
                        <tr style="border-style: none; text-align: center; height: 20px">
                            <td style="border-style: none; width :20%">
                                名称：
                            </td>
                            <td style="border-style: none; text-align: left; width :70%">
                                <asp:TextBox ID="editNameTxtBox" runat="server" Width="90%"></asp:TextBox>
                            </td>
                        </tr>
                        <tr style="border-style: none; text-align: center;">
                            <td>
                            </td>
                            <td>
                               <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="请输入名称"
                                Text="请输入名称" ControlToValidate="editNameTxtBox" ValidationGroup="editValidations"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td style="text-align: center">
                        <asp:Button ID="saveBtn" runat="server" Text="保存退出" OnClick="saveBtn_Click" ValidationGroup="editValidations"/>
                        <asp:Button ID="cancelBtn" runat="server" Text="关闭" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="EditMsgLbl" runat="server" ForeColor="Red"></asp:Label>
                    </td>
                </tr>
            </table>
        </div>
        <div class="box-footer">
            <img alt="" src="image/stdBox_left_bottom.gif" />
            <p>
                &nbsp;</p>
        </div>
    </asp:Panel>
</asp:Content>

